package com.demo.finkjava.job;

import lombok.extern.slf4j.Slf4j;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.springframework.stereotype.Component;

/**
 * flink任务示例
 */
@Component
public class FlinkJobExample {

   public void execute() throws Exception {
       //流处理
//       StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

       //批处理
       ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();


       // 任务的详细逻辑
       // 提交任务
       env.execute("job name");
   }
}
